package cn.royan.fl.controllers.commands 
{
	import cn.royan.fl.interfaces.IRequest;
	import cn.royan.fl.proxys.PacketDispatchProxy;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author RoYan
	 */
	public class PacketDispatchCommand extends SimpleCommand 
	{
		override public function execute(notification:INotification):void 
		{
			super.execute(notification);
			if ( !facade.hasProxy( PacketDispatchProxy.NAME ) )
				facade.registerProxy( new PacketDispatchProxy() );
				
			var packetDispatchProxy:PacketDispatchProxy = facade.retrieveProxy( PacketDispatchProxy.NAME ) as PacketDispatchProxy;
				packetDispatchProxy.sendPacket( notification.getBody() as IRequest );
		}
	}

}